<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="Veterinaria.modelo.Persona"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type='text/javascript'> 
<!--
function CargarFoto(img, ancho, alto){  
	derecha=(screen.width-ancho)/2;  
	arriba=(screen.height-alto)/2;  
	string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";  
	fin=window.open(img,"",string);
}
// -->
</script> 
<script type="text/javascript">
function exportToXL(eSrc)
{
 var oExcel; 
 var oExcelSheet; 
 var oWkBooks;
 var cols; 
 oExcel = new ActiveXObject('Excel.Application');
 oWkBooks = oExcel.Workbooks.Add;
 oExcelSheet = oWkBooks.Worksheets(1);
 oExcelSheet.Activate();
 if (eSrc.tagName != 'Exportar')
 {
  alert('No ha sido posible exportar la tabla a excell');
  return false;
 }
 cols = Math.ceil(eSrc.cells.length / eSrc.rows.length);
 for (var i = 0; i < eSrc.cells.length; i ++)
 {
  var c, r;
  r = Math.ceil((i+1) / cols);
  c = (i+1)-((r-1)*cols)
  if (eSrc.cells(i).tagName == 'th') 
  { 
   oExcel.ActiveSheet.Cells(r,c).Font.Bold = true;
   oExcel.ActiveSheet.Cells(r,c).Interior.Color = 14474460; 
  }
  if (eSrc.cells(i).childNodes.length > 0 && eSrc.cells(i).childNodes(0).tagName == "B") 
   oExcel.ActiveSheet.Cells(r,c).Font.Bold = true;
   oExcel.ActiveSheet.Cells(r,c).Value = eSrc.cells(i).innerText;
 }
 oExcelSheet.Application.Visible = true;
}
</script>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Reporte de Due&ntilde;o - petVida - Veterinaria</title>
<style type="text/css">
<!--
.Estilo1 {	font-family: Tahoma;
	font-weight: bold;
	font-size: 18px;
}
.Estilo4 {font-family: Tahoma; font-weight: bold; font-size: 12px; }
.Estilo7 {font-family: Tahoma; font-size: 12px; }
.Estilo5 {font-family: Tahoma;  font-size: 10px;}
-->
</style>
</head>

<body>


<table width="1124" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><p align="left"><img src="img/logo3.jpg" alt="s" width="472" height="185" /></p></td>
    <td><p>&nbsp;</p>
        <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p align="right" class="Estilo1">Reporte Due&ntilde;o  </p></td>
  </tr>
  <tr bgcolor="#CCCCCC">
    <td height="10" colspan="2"><div align="right"></div></td>
  </tr>
</table>
<%@include file="navegador.jsp" %> 
    <table width="854" border="0" align="center">
      <tr>
        <td>
        <form name="buscarNombre" method="post" action="ReporteDuenoServlets">
          <table width="238" border="0" align="center">
            <tr class="Estilo4">
              <td><div align="center">Tipo</div></td>
              <td><div align="center">Nombre</div></td>
              <td><div align="center">Apellido</div></td>
              <td><div align="center">Ruc</div></td>
              <td><div align="center">Estado</div></td>
            </tr>
            <tr>
              <td><span class="Estilo7">
                <label></label>
                <label>
                <select name="select2">
				  <option ></option>
                  <option value="D">Due&ntilde;o</option>
                  <option value="P">Prospecto</option>
                </select>
                </label>
              </span></td>
              <td><input name="txtNombre" type="text" id="txtNombre" /></td>
              <td><span class="Estilo7">
                <label>
                <input name="txtApellido" type="text" id="txtApellido" />
                </label>
              </span></td>
              <td><span class="Estilo7">
                <label>
                <input name="txtRuc" type="text" id="txtRuc" />
                </label>
              </span></td>
              <td><span class="Estilo7">
                <label>
                <select name="select">
                <option ></option>
                  <option value="1">Activo</option>
                  <option value="0">Desactivo</option>
                    </select>
                </label>
              </span></td>
            </tr>
            
            <tr>
              <td colspan="5"><label>
                  <div align="center">
                    <input type="submit" name="Submit" value="Buscar" />
					</div>
                </label></td>
            </tr>
          </table>
         </form>        </td>
        </tr>
    </table>
    <p>&nbsp;</p>
    <table width="819" border="0" align="center">
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
         
        <td><span id="Exportar_a_Excel"><table name="Exportar" width="819" border="0" align="center">
            <tr bgcolor="#CCCCCC" class="Estilo4">
              <td><div align="center">idDueno</div></td>
              <td><div align="center">Nombre</div></td>
              <td><div align="center">Apellido</div></td>
              <td><div align="center">Email</div></td>
              <td><div align="center">Direcci&oacute;n</div></td>
              <td><div align="center">Tel&eacute;fono</div></td>
              <td><div align="center">Celular</div></td>
              <td><div align="center">Sexo</div></td>
              <td><div align="center">Ruc</div></td>
              <td><div align="center">Estado</div></td>
              <td><div align="center" class="Estilo4">Notas</div></td>
              <td><div align="center" class="Estilo4">Imagen</div></td>
            </tr>
           <%@page import="java.util.*, Veterinaria.modelo.Persona" %>
			<%
			Collection<Persona> arreglo = (ArrayList<Persona>)request.getAttribute("personas");
			if(arreglo != null) { 
			int i = 1;
			for(Persona x : arreglo) {
			%>  
			  <tr class="Estilo5">
			    <td><div align="center" ><% out.print(x.getCodigo_persona()); %></div></td>
			    <td><% out.print(x.getNombre_persona()); %></td>
			    <td><% out.print(x.getApellido_persona()); %></td>
			    <td><% out.print(x.getEmail_persona()); %></td>
			    <td><% out.print(x.getDireccion()); %></td>
			    <td><% out.print(x.getTelefono_fijo()); %></td>
			    <td><% out.print(x.getTelefono_celular()); %></td>
			    <td><div align="center">
			      <% out.print(x.getSexo()); %>
			      </div></td>
			    <td><% out.print(x.getRuc()); %></td>
			     <% String estado;
			    if( x.getEstado().toString().equals("1") ){
			    	estado = "Activo";
			    }
			    else{
			    	estado = "Desactivo";	
			    }
			    %>
			     <td><div align="center"><% out.print(estado); %></div></td>
			     <td><% out.print(x.getoDueno().getNotas()); %></td>
<%-- 			     '<% out.print(x.getoDueno().getImagen()); %>' --%>
<!-- 			      file:///D:/UPC/Programas/eclipse_indigo_64_svn_android/Workspace/ThunderBolt/WebContent/img_pet/D0002.jpg -->
			       <td><a href="javascript:CargarFoto('<% out.print(x.getoDueno().getImagen()); %>','250','300')"><center>Ver</center></a></td>
			       
			       <td></td>
			       
			     <td>&nbsp;</td>
			     <td>&nbsp;</td>
			  </tr>
			<% }  
			  } %>

  
</table>
        </span> 
        <tr>
              <td colspan="10"><label></label>
                <p align="center" class="Estilo4">&nbsp;</p>                
        </tr>
      </table></td>
      </tr>
    </table></td>
  </tr>
  </form>
  <tr >
    <td colspan="2"><div align="center" ><span class="Estilo4">Desarrollado por Grupo ThunderBolt<img src="img/Rayo.png" alt="s" width="28" height="21" /></span> </div></td>
  </tr>
</table>
<p></p>
</body>
</html>
